package com.example.AIstudy.controller;

import com.example.AIstudy.exception.AIstudyException;
import com.example.AIstudy.service.UserSkillScoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/userSkill")
@Api(tags = "用户薄弱点管理API")
public class UserSkillScoreController {

    @Autowired
    UserSkillScoreService userSkillScoreService;
    @ApiOperation("定时任务，每天零点更新用户近一个月的做题情况，并且更新到表格中，供之后查询")
//    @Scheduled(cron="0 0 0 * * *")
    @GetMapping("/updateRecord")
    void insertUserSkillRecord() throws AIstudyException {
           userSkillScoreService.updateUserSkill();
    }
}
